{%extends "base.html"%}
{%block title%}{{request.session.userinfo.username}}{%endblock%}
{%block sideleft%}{%include "sideleft.html"%}{%endblock%}
{%block content%}
<!--登录成功以后的内容-->
<style>

</style>

<script type="text/javascript">
function getCityOptions(province_id){
	$.ajax({
        type:"GET",
        url:"/getCityList?provinceID="+province_id,       
        dataType:'json',
        success: function(data,textStatus){
            var citySelect = document.getElementById("id_city");
            for ( var i=citySelect.options.length-1; i>-1; i--){   
                citySelect[i] = null;   
            }     
            if(data.length>0){ 
            	$("#id_city").val(data[0].text);
                for(i=0;i<data.length;i++){
                    citySelect.options[i] = new Option();   
                    citySelect.options[i].text = data[i].label;  
                    citySelect.options[i].value = data[i].text; 
                }
            }
        }  
        
    });       
}
</script>
<div class="accounts">
	<h1>{{request.session.nickname}}的帐号</h1>
	<div id='self_nav'>
		<ul>
			<li class='current'><a href="/accounts/">个人信息</a></li>
			<li><a href="/accounts/changepassword/">修改密码</a></li>
			<li><a href="/accounts/friends/">朋友们</a></li>
		</ul>
	</div>
	<div class="clearer"></div>
	<div id='self_info'>
		<h2>{%if messages%}
			{%for message in messages%}
				{{message}}
			{%endfor%}
		{%endif%}</h2>
		<form action="/accounts/" method="post">{% csrf_token %}
			<ul>
				<li>头像:<image src='{{user.profile_image}}' />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='/accounts/user_icon'>修改</a></li>
				<li>城市:{{form.province}}&nbsp;&nbsp;{{form.city}}</li>
				<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='submit' value='更新个人资料'/></li>
			</ul>
		</form>
	</div>
</div>

{%endblock%}
{%block sideright%}{%include "sideright.html"%}{%endblock%}